package com.bdqn.ch06.service;

import com.bdqn.ch06.entity.User;
import com.bdqn.ch06.repository.UserRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImp implements UserService {

    @Resource
    UserRepository userRepository;

    @Override
    public User getUserByIdService(Long id) {
        return userRepository.findById(id).get();
    }

    @Override
    public User findByUserNameBiz(String usrName) {
        return userRepository.findUserByUsrName(usrName);
    }
}
